import React from 'react'
import CommonBoxView from './CommonBoxView'
import type { ColumnsType } from 'antd/es/table';
import { Image } from 'antd'
import './index.less'

interface DataType {
  imgUrl: string;
  jumpUrl: string;
}

const BannerManger: React.FC = () => {
  const columns: ColumnsType<DataType> = [
    {
      title: '图片地址',
      dataIndex: 'imgUrl',
      key: 'imgUrl',
      render: text => <Image src={text} />,
    },
    {
      title: '跳转地址',
      dataIndex: 'jumpUrl',
      key: 'jumpUrl',
      render: text => text,
    }
  ]
  return (
    <>
      <CommonBoxView
        title='图片管理'
        columns={columns}
        paramsObj={{
          url: "/banner/bannerList",
          method: "POST",
          data: {
            pageNum: "1",
            pageSize: "10"
          }
        }}
        listName="bannerList"
      />
    </>
  )
}

export default BannerManger